Repository navigation
fix(usage): refresh Magpie limits live and re-probe exhaustion - #170
nullStack65 wants to merge 1 commit into
Conversation
A manual Limits refresh was reading Magpie's cached card list, so the panel kept stale cards or said instances had no quota when Magpie had cards. It now posts the live quota reread and ignores a cached object body. The same click clears in-memory exhaustion and marks a vendor that is still out. Automatic refreshes still share one in-flight read and wait five minutes. A manual click waits out an automatic read, then forces the live reread. The pre-commit knip check fails on four unused files this change does not touch: .github/scripts/mirror-play-apk.cjs, apps/web/scripts/verify-built-boot.ts, scripts/resolve-nightly-release.ts, and scripts/smoke-cli-archive.ts. Fmt and lint passed. Model: grok-4.7 Task: implement Agent: grok Harness: grok
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Note 🤖 grok-4.7 responding on behalf of nullStack65 Not merged. Head The diff matches the handoff. A manual Limits refresh sends The required check on this branch is |
|
Note 🤖 grok-4.7 responding on behalf of nullStack65 The required check is green on head Latest run of each check name is success. The required aggregator REST Merge waits for one substantive bot review of this exact head. Nothing was deployed. |
|
Frozen 2026-11-22 CEO portfolio audit — cash-path priority; can reopen at the Dec 18 runway check. |
A manual click on Limits refresh kept Magpie's cached cards, so the panel stayed stale or said instances had no quota when Magpie already had cards. The click now forces the live quota reread, clears in-memory exhaustion for those instances, and marks a vendor that is still out.
The Limits button asks the server to reread Magpie. The server posts
/api/usage/quotas/refreshfor each Magpie-backed card, the same operation asmagpie quota refresh. A JSON object on that route is the cached list, so it is an error, not a success. The cachedGET /v1/magpie/quotaspath is unchanged and still serves automatic refresh. Automatic refresh still shares one in-flight read and skips for five minutes. A manual click waits for an in-flight automatic read, then starts the live reread anyway.After a successful live reread, T3 clears
ProviderExhaustionfor each Magpie route and marks it again when every readable account is still spent. An unread or failed origin is left alone, so a failed refresh does not look available. The refusal text is unchanged:Provider "<instanceId>" is out of usage until <iso>; pick another provider.Model: grok-4.7
Task: implement
Agent: grok
Harness: grok
Verified at
b4f63285e4a20e1b102c8f4f3d8229d6b7f40966with Node 26.13.1:magpieQuotas.test.ts(13): live POST URLs, last card list kept, cached object body rejected, hanging body gives up.UsageLimitSources.test.ts(16): live refresh posts the reread and a still-spent account is marked again.usage.test.ts(7): automatic refresh coalesces; a manual click is not swallowed by the five-minute gate.usageLimitsRefresh.test.ts(3): a manual refresh sendsliveQuotaRefresh.usageLimits.test.ts(100): the pooled empty count drops once Magpie has cards for that driver.ModelAlertReactor.test.ts(42):reapplyclears, then marks when the probe is still exhausted.effect-tsgoon the server, contracts, shared, client-runtime, web, and mobile packages: no new type errors..github/scripts/mirror-play-apk.cjs,apps/web/scripts/verify-built-boot.ts,scripts/resolve-nightly-release.ts, andscripts/smoke-cli-archive.ts.pnpm install --offline --frozen-lockfilecould not run: the local metadata mirror is empty (ERR_PNPM_NO_OFFLINE_META). A networkpnpm install --frozen-lockfilesucceeded and did not change the lockfile. The live Magpie process was not called. CI on this head has not been watched.Deploy: none